package com.binvshe.binvshe.mine.corporation;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.binvshe.binvshe.R;
import com.binvshe.binvshe.account.Account;
import com.binvshe.binvshe.account.AccountManager;
import com.binvshe.binvshe.account.utils.FragmentUtils;
import com.binvshe.binvshe.organization.OpusFragment;
import com.pachong.android.baseuicomponent.activity.BaseActivity;

/**
 * 我的社团页面
 */
public class MyClubActivity extends BaseActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN|View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
            getWindow().setStatusBarColor(Color.TRANSPARENT);
        }
        hideToolbar();
        initView();
    }

    public static void start(Context context) {
        Intent starter = new Intent(context, MyClubActivity.class);
        context.startActivity(starter);
    }

    private void initView() {
        Account account=AccountManager.getCurrentAccount();
        FragmentUtils.replaceFragment(getSupportFragmentManager(), R.id.relytClubOpus, OpusFragment.newInstance(account.getClub().getId()));
    }

    @Override
    public View createDataView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.act_my_club, null);
    }


}
